[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
AND(IEXP1,IEXP2) (INTEGER)
Function
Calculate the bitwise AND of two integer arguments.
Syntax
AND(iexp1,iexp2)
iexp1 = Any integer expression.
iexp2 = Any integer expression.
Return Type & Value
INTEGER
Returns the bitwise AND of iexp1 and iexp2.
Remarks
This function may be used to clear selected bits in an integer
expression by ANDing the expression with a mask that has the bits to
clear set to 0 and the bits to ignore set to 1. Another use is to
calculate the remainder of a division operation by a power of two by
ANDing the dividend with the power of two minus one.
Examples
' Clear the high word, keeping only the low word
PRINTLN "07FFFFFFFh AND 0FFFFh = ",AND(07FFFFFFFh,0FFFFh)
' In this case 123%16 = AND(123,15) (15 = 1111b)
PRINTLN "The remainder of 123 divided by 16 is ",AND(123,1111b)
See Also:
NOT()
OR()
XOR()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson